package br.unifor.cct.mia.gui.FileFilters;

import java.io.File;

import javax.swing.filechooser.FileFilter;

public class SERFileFilter extends FileFilter {
    public boolean accept(File f) {
        if ( f.isDirectory() ) return true;
        
        String ext = null;
        String s = f.getName();
        int i = s.lastIndexOf('.');
        if (i > 0 &&  i < s.length() - 1) {
            ext = s.substring(i+1).toLowerCase();
        }
                
        if ( ext!=null && ext.equalsIgnoreCase("ser") ) return true;
        else return false;
    }

    public String getDescription() {
        return "*.ser";
    }


}
